Guild icon
Project Sekai
🔒 CrewCTF 2023 / ✅-crypto-nec
Avatar
nec - 1000 points
Category: Crypto Description: Not Easy Crypto (we hope) NOTE: The intended solution is to apply bivariate Coppersmith method after solving nec_easy challenge part. We do not know how to solve this with known libraries directly, you may need to modify some known library. If you solved this challenge, let us know. Author : kiona nc nec.chal.crewc.tf 20005 Files:Tags: No tags.
Sutx pinned a message to this channel. 07/08/2023 10:00 AM
Avatar
@layka_ wants to collaborate 🤝
10:04
@Aptx wants to collaborate 🤝
10:07
@kanon wants to collaborate 🤝
Avatar
@Utaha wants to collaborate 🤝
Avatar
@layka_ send me the script to find r
Avatar
you still need it ?
13:08
diff_sig1, diff_sig2 = [], [] for i in range(4 - 1): for j in range(i+1, 4): diff_sig1.append(sigs[i][1] - sigs[j][1]) diff_sig2.append(sigs[i][0] - sigs[j][0]) a_0, b_0 = diff_sig1[0], diff_sig2[0] a_1, b_1 = diff_sig1[1], diff_sig2[1] a_2, b_2 = diff_sig1[2], diff_sig2[2] a_3, b_3 = diff_sig1[3], diff_sig2[3] rk = GCD(a_2*b_0 - a_0*b_2, a_0*b_1 - a_1*b_0, a_2*b_1 - a_1*b_2, a_3*b_1 - a_1*b_3, a_3*b_0 - a_0*b_3) r = int(list(factor(rk))[-1][0]) assert isPrime(r) print(r)
Avatar
I cannot of a way that we can use r to factor N
Avatar
wait why do they give intended solution explicitly in the challenge description
Avatar
maybe they find it too hard msfrog
Avatar
seems like we can get d and r by the previous part
21:04
and a bunch of G = (known, ?), where G is actually unknown except that its order is r (edited)
Avatar
oh maybe all we need is just q ~ rh
21:14
ok I see why it's bivariate coppersmith lol
21:16
(r * h + small) = 0 (mod q) and we know N beta ~ 0.737 h, small are unknown small number
Avatar
lol cheesed
👀 1
Avatar
Avatar
Utaha
used /ctf solve
✅ Challenge solved.
Avatar
what was it ?
Avatar
@Utaha How did you setup the params for coppersmith, i tried it yesterday but it didn't worked 🥲
Avatar
what was the trick .. what poly to solve ?
Avatar
r * h + small = 0 (mod q)
Avatar
q is unkown
Avatar
Yeah but you know N
Avatar
owww you mean mod N ?
Avatar
so it will be rrr* r * h + small * rrr = 0 mod N
01:40
so coppersmith will spit small * rrr ?
Exported 30 message(s)